/*
 * Copyright 2008 Lucifer Lu
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using System.Collections.Generic;
using SilverChart.Core.Configuration;
using SilverChart.Core.Service;

namespace SilverChart.Configuration {
    /// <summary>
    /// Description of YAxis.
    /// </summary>
    [ServiceProvider(ServiceName = "Configuration Item: YAxis", Singleton = false)]
    [ConfigurationItem(Configurations.ITEM_NAME_YAXIS, CreateForDefault = true, Parent = typeof(Configurations))]
    public class YAxis : AxisBase {
        public const String ITEM_NAME_MINVALUE = "min";
        public const Double DefaultMinValue = Double.NaN;
        private ValueItemHelper<Double> minValue;

        public const String ITEM_NAME_MAXVALUE = "max";
        public const Double DefaultMaxValue = Double.NaN;
        private ValueItemHelper<Double> maxValue;

        public YAxis(ConfigurationParser parser)
            : base(parser) {
            minValue = new SimpleValueItemHelper<Double>(this, ITEM_NAME_MINVALUE, DefaultMinValue);
            maxValue = new SimpleValueItemHelper<Double>(this, ITEM_NAME_MAXVALUE, DefaultMaxValue);
        }

        public Double MinValue { get { return minValue.Value; } }
        public Double MaxValue { get { return maxValue.Value; } }
    }
}
